
## 平台选择
include ../../platform/ubuntu/x86_64.mk
# include ../../platform/android/armeabi-v7a.mk
# include ../../platform/android/arm64-v8a.mk
# include ../../platform/android/mips64.mk
# include ../../platform/android/x86.mk
# include ../../platform/android/x86_64.mk

PLAT_PARAM += ARCH=$(ARCH)
PLAT_PARAM += CROSS=$(CROSS)
PLAT_PARAM += GCC=$(GCC)
PLAT_PARAM += GXX=$(GXX)
PLAT_PARAM += AR=$(AR)
PLAT_PARAM += AS=$(AS)
PLAT_PARAM += NM=$(NM)
PLAT_PARAM += RANLIB=$(RANLIB)
PLAT_PARAM += STRIP=$(STRIP)
PLAT_PARAM += OBJDUMP=$(OBJDUMP)
PLAT_PARAM += LD=$(LD)
PLAT_PARAM += EXT_CFLAGS=$(EXT_CFLAGS)
PLAT_PARAM += EXT_INCS=$(EXT_INCS)
PLAT_PARAM += EXT_LIBS=$(EXT_LIBS)

CFLAGS += -Wall -static

INCS += -I../
INCS += -I../libs/include
INCS += -I../libs/include/freetype2

LIBS += -L../libs/lib

all: freetype jpeg png

freetype:
	@$(GCC) -o out.$@ $@.c ../lib_$@_adapt.c \
	$(INCS) $(LIBS) $(CFLAGS) -lfreetype -lpng -lz -lm

jpeg:
	@$(GCC) -o out.$@ $@.c ../lib_$@_adapt.c \
	$(INCS) $(LIBS) $(CFLAGS) -ljpeg

png:
	@$(GCC) -o out.$@ $@.c ../lib_$@_adapt.c \
	$(INCS) $(LIBS) $(CFLAGS) -lpng -lz -lm

libs:
	@make -C ../ $@ $(PLAT_PARAM)

clean:
	@rm -rf out*

cleanall: clean
	@make -C ../ $@ $(PLAT_PARAM)
